{{if validation_errors()}}
<ul class="message error">
    <li>{{validation_errors()}}</li>
</ul>
{{/if}}

<div class="clear"></div>
<form class="block-content form" id="simple_form" method="post" action="create" enctype="multipart/form-data">
    <h1>{{$data->lang->line('data')}}</h1>
    <ul class="tabs js-tabs same-height">
        <li class="current"><a href="#tab-locales" title="Locales">{{$data->lang->line('current')}}</a></li>
        <li><a href="#tab-options" title="Options">{{$data->lang->line('options')}}</a></li>    
    </ul>
    <div class="tabs-content">

        <div id="tab-locales">
            {{if isset($data->id)}}{{form_hidden('id', $data->id)}}{{/if}}

            <fieldset class="grey-bg required">			
                <legend>{{$data->lang->line('required')}}</legend>
                <p>
                    <label for="simple-required">{{$data->lang->line('title')}}</label>
                    <input type="text" name="title" id="simple-required" value="{{if isset($data->title)}}{{$data->title}}{{/if}}" class="full-width">
                    {{form_error('title')}}                                
                </p>
            </fieldset>

            <fieldset>
                <legend>{{$data->lang->line('other_info')}}</legend>
                <p>
	                <label for="link">{{$data->localize_label('data_code')}}</label>				
	                <input type="text" name="code" class="full-width" value="{{if isset($data->code)}}{{$data->code}}{{/if}}">				
	            </p>
                <p>
                    <label for="description">{{$data->lang->line('title')}}</label>
                    <textarea name="description" cols="10" class="full-width text-content tinymcefull">{{if isset($data->description)}}{{$data->description}}{{/if}}</textarea>
                </p>
                <p>
                    <label for="file-name" class="full-width">{{$data->localize_label('userfile')}}</label>				
                    <input type="file" name="userfile" size="20" />

                </p>
                <p>
                    <label for="simple-select">{{$data->lang->line('type')}}</label>
                    <select name="type" id="simple-select" class="full-width">
                        {{html_options options=$data->type_list() selected=$data->type}}
                    </select>
                </p>
            </fieldset>
        </div>
        <div id="tab-options">
        	<p>
                <label for="link">{{$data->localize_label('link')}}</label>				
                <input type="text" name="link" class="full-width" value="{{if isset($data->link)}}{{$data->link}}{{/if}}">				
            </p>
            <p>
                <label for="name">{{$data->localize_label('name')}}</label>				
                <input type="text" name="name" class="full-width" value="{{if isset($data->name)}}{{$data->name}}{{/if}}">				
            </p>			
            <p>
                <label for="simple-select">{{$data->lang->line('position')}}</label>
                <select name="feature" id="simple-select" class="full-width">
                    <option value="0" {{if (isset($data->feature)) and ($data->feature == 0)}}selected="selected"{{/if}}>Trang tin tức</option>
                    <option value="1" {{if (isset($data->feature)) and ($data->feature == 1)}}selected="selected"{{/if}}>Trang chủ</option>
                </select>
            </p>
            <p>
                <label for="simple-select">{{$data->lang->line('partner')}}</label>
                <select name="partner_id" id="simple-select" class="full-width">
                    {{html_options options=$data->partner_list() selected=$data->partner_id}}
                </select>
            </p>
            
             <p>
                <label for="simple-select">{{$data->lang->line('language')}}</label>
                <select name="lang_id" id="simple-select" class="full-width">
                    {{html_options options=$language->get_list() selected=$data->language_id}}
                </select>
            </p>

            <p>
                <label for="image">{{$data->lang->line('creator')}}</label>				
                <input type="text" name="creator_id" class="full-width" value="">				
            </p>

            <div class="columns">
                <div class="colx2-left">
                    <label for="content">{{$data->lang->line('simple-calendar')}}</label>
                    <span class="input-type-text margin-right relative">
                        <input type="text" name="simple-calendar" id="simple-calendar" value="">
                        <img src="{{base_url()}}data/templates/backend/xgo/images/icons/fugue/calendar-month.png" width="16" height="16">
                    </span> 

                </div>
                <p class="colx2-right">					
                    <label for="active">{{$data->lang->line('active')}}</label>
                    <input type="checkbox" name="active" id="simple-switch-on" value="1" checked="checked" class="switch" onclick="$(this).setActive();">
                </p>
            </div>

            <div class="columns">
                <div class="colx2-left">
                    <label for="active">{{$data->lang->line('viewed')}} <b>1002</b></label>
                </div>
                <p class="colx2-right">					
                    <label for="active">{{$data->lang->line('editor')}}<b>{{if isset($data->updated)}}{{$data->updated}}{{/if}}</b></label>
                </p>
            </div>

        </div>
        <br><br><br><br>
        <fieldset class="grey-bg no-margin">
            <legend>{{$data->lang->line('action')}}</legend>
            <p class="input-with-button">
                <button type="submit">{{$data->lang->line('save')}}</button>
            </p>
        </fieldset>	

    </div>
</form>
